function setTab(name,cursel,n){
    for(i=1;i<=n;i++){
        var menu=document.getElementById(name+i);
        var con=document.getElementById("con_"+name+"_"+i);
        menu.className=i==cursel?"hover":"";
        con.style.display=i==cursel?"block":"none";
    }
}

function obj(e){
    return document.getElementById(e);
}
function selectSort(name,cursel,n){
    for(i=1;i<=n;i++){
        var menu=obj(name+i);
        menu.className=i==cursel?"hover":"";
    }
}
function cateOver(){
    if(obj("list_cate")){
        obj("list_cate").style.display="";
    }
}
function cateOut(){
    if(obj("list_cate")){
        obj("list_cate").style.display="none";
    }
}
function showObj(){
    var address=obj("good_address");
    var address_a=obj("address_a");
    address.style.display="block";
    address_a.className="hover";
}
function hideObj(){
    var address=obj("good_address");
    var address_a=obj("address_a");
    address.style.display="none";
    address_a.className="";
}
function check_storage(goods_id,cid){
    var info        = new Object();
    info.goods_id = goods_id;
    info.cid      = cid;
    Ajax.call('goods.php?act=storage', 'info=' + info.toJSONString(), changeHtml, 'POST', 'JSON');
}

function changeHtml(result){
    var address_span=obj("address_span");
    
    address_span.innerHTML=result.message;
    
}
function hideKc(){
   
    var good_address=obj("good_address");

    good_address.style.display="none";
}

function showReply(){
    var replyform=obj("replyform");
    replyform.style.display = replyform.style.display=="none"?"block":"none";
}
function showReply1(){
    var replyform1=obj("replyform1");
    replyform1.style.display = replyform1.style.display=="none"?"block":"none";
}
function hideReply1(){
    var star=obj("star");
    var starF=obj("starF");
    var replyform1=obj("replyform1");
    replyform1.style.display="none";
    star.className="sa0";
    starF.innerHTML="";
}
function starX(i){
    var star=obj("star");
    var starF=obj("starF");
    star.className="sa"+i;
    starF.innerHTML=i+"分";
    var dc = document.getElementById('comment_rank');
    dc.value = i;
}

function save(title, url){
    if (document.all)
    window.external.AddFavorite(url, title);
    else if (window.sidebar)
    window.sidebar.addPanel(title, url, "");
}
function setCookies(name,value)
{
　　 var Days = 2; 
　　 var exp　　 = new Date();
　　 exp.setTime(exp.getTime() + Days*24*60*60*1000);
　　 document.cookie = name + "="+ escape(value) +";expire*="+ exp.toGMTString();
}
function getCookies(name)
{
　　 var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
　　 if(arr != null) return unescape(arr[2]); return null;
}
